<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>年检申报管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){

					var fileName = $("#files").val();
					var fileName2 = $("#files2").val();
					var fileName3 = $("#files3").val();
					var account = $("#account").val();
					var admin = $("#admin").val();
					if(fileName == "" && admin == "0"){
						showTip("请添加报告书!");
					}else if(fileName2 == "" && admin == "0"){
						showTip("请添加" + account);
					}else if(fileName3 == "" && admin == "0"){
						showTip("请添加登记证书正反面!");
					}else{
						loading('正在提交，请稍等...');
						form.submit();
					}
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>

	<shiro:lacksPermission name="mzb:mzbYearcheck:admin">
		<c:set var="editRemarks" value="0"></c:set>
	</shiro:lacksPermission>
	<shiro:hasPermission name="mzb:mzbYearcheck:admin">
		<c:set var="editRemarks" value="1"></c:set>
	</shiro:hasPermission>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/mzb/mzbYearcheck/uncheck">年检申报列表</a></li>
		<li class="active"><a href="${ctx}/mzb/mzbYearcheck/form?id=${mzbYearcheck.id}">年检申报修改</a></li>
	</ul><br/>


	<form:form id="inputForm" modelAttribute="mzbYearcheck" action="${ctx}/mzb/mzbYearcheck/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>


		<div class="control-group">

			<label class="control-label">报告书：
				<%--<br><a href="http://www.baidu.com">1.民办非企业单位年检工作报告书(双重管理)</a>--%>
				<%--<br><a href="http://www.baidu.com">2.民办非企业单位年检工作报告书(直接管理)</a>--%>
				<%--<br><a href="http://www.baidu.com">3.社会团体年度工作报告书(双重管理)</a>--%>
				<%--<br><a href="http://www.baidu.com">4.社会团体年度工作报告书(直接管理)</a>--%>

			</label>
			<div class="controls">
				<form:hidden id="files" path="files" htmlEscape="false" maxlength="2000"  />
				<shiro:lacksPermission name="mzb:mzbYearcheck:admin">
					<input type="hidden" id="admin" value="0">
					<sys:ckfinder input="files" type="files" uploadPath="/mzb/mzbYearcheck" selectMultiple="true"   readonly="${mzbYearcheck.status == '3' ? 'true' : 'false'}"/>
				</shiro:lacksPermission>
				<shiro:hasPermission name="mzb:mzbYearcheck:admin">
					<input type="hidden" id="admin" value="1">
					<sys:ckfinder input="files" type="files" uploadPath="/mzb/mzbYearcheck" selectMultiple="true" />
				</shiro:hasPermission>
				<br><br>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">${mzbYearcheck.createBy.office.name eq '社会团体' ? "银行帐户对账单:" : "财务审计报告:"}</label>
			<input type="hidden" id="account" value="${mzbYearcheck.createBy.office.name eq '社会团体' ? '银行帐户对账单:' : '财务审计报告:'}" />
			<div class="controls">
				<form:hidden id="files2" path="files2" htmlEscape="false" maxlength="2000"  />
				<shiro:lacksPermission name="mzb:mzbYearcheck:admin">
					<sys:ckfinder input="files2" type="images" uploadPath="/mzb/mzbYearcheck" selectMultiple="true" readonly="${mzbYearcheck.status == '3' ? 'true' : 'false'}" maxWidth="800" maxHeight="800"/>
				</shiro:lacksPermission>
				<shiro:hasPermission name="mzb:mzbYearcheck:admin">
					<sys:ckfinder input="files2" type="images" uploadPath="/mzb/mzbYearcheck" selectMultiple="true"  maxWidth="500" maxHeight="500"/>
				</shiro:hasPermission>
				<br><br>
			</div>
		</div>


		<div class="control-group">
			<label class="control-label">登记证书正反面:</label>
			<div class="controls">
				<form:hidden id="files3" path="files3" htmlEscape="false" maxlength="2000"  />
				<shiro:lacksPermission name="mzb:mzbYearcheck:admin">
					<sys:ckfinder input="files3" type="images" uploadPath="/mzb/mzbYearcheck" selectMultiple="true" readonly="${mzbYearcheck.status == '3' ? 'true' : 'false'}" maxWidth="800" maxHeight="800"/>
				</shiro:lacksPermission>
				<shiro:hasPermission name="mzb:mzbYearcheck:admin">
					<sys:ckfinder input="files3" type="images" uploadPath="/mzb/mzbYearcheck" selectMultiple="true" maxWidth="500" maxHeight="500"/>
				</shiro:hasPermission>
			</div>
		</div>

		<c:if test="${mzbYearcheck.status != 3 }">
			<div class="control-group">
				<label class="control-label">审核意见：</label>
					<div class="controls">
						<form:textarea path="remarks" htmlEscape="false" rows="10"  onclick="changeOpinion(this)" readonly="${editRemarks == 0 ? 'true' : 'false'}" class="input-xxlarge" />
					</div>
			</div>
		</c:if>
		<shiro:hasPermission name="mzb:mzbYearcheck:admin">
			<div class="control-group">
				<label class="control-label">审核情况:</label>
				<div class="controls">
					<form:radiobuttons  path="status" items="${fns:getDictList('check_flag')}"  itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
					<span class="help-inline"></span>
				</div>
			</div>
		</shiro:hasPermission>

		<div class="form-actions">
			<c:if test="${mzbYearcheck.status != '3'}"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</c:if>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
<script>
	function changeOpinion(obj){
		alert(obj.value);
	}
</script>
</html>
